<%@page import="com.wanmait.cookbook.vo.RecipeType"%>
<%@page import="com.wanmait.cookbook.vo.RecipeTypeSecond"%>
<%@page import="java.util.List"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%
	List<RecipeType> recipeTypes = (List<RecipeType>) request.getAttribute("recipeTypes");

	for (int i = 0; i < recipeTypes.size(); i++) 
	{
%>
<div class="citem clearfix">
	<span><%=recipeTypes.get(i).getTitle()%></span>
	<div class="imublo clearfix">
		<%
			List<RecipeTypeSecond> recipeTypeSeconds = (List<RecipeTypeSecond>) request.getAttribute("recipeTypeSeconds");
				int count=0;
				for (int j = 0; j < recipeTypeSeconds.size(); j++) 
				{
				
					if (recipeTypeSeconds.get(j).getRecipeType().getId() == recipeTypes.get(i).getId()) 
					{
						count++;
					if(count>6){continue;}
		%>
		<a href="<%=request.getContextPath() %>/indexServlet?action=recipetypeSecond&name=<%=recipeTypeSeconds.get(j).getTitle() %>" target="_blank"><%=recipeTypeSeconds.get(j).getTitle()%></a>
		<%
			  		}

				}
		%>
	</div>
</div>
<%
	}
%>